Thread:       how to get the current working directory
Message:      00002_0007
From:         "fd809" <fd809@some.web.address.com>
Text:

hello,
How do you get the currentl working directory into a variable in perl ?
and how do you change the directory inside a perl script.

like say if i am in c:\perl
and i need to make the current directory as:=20
c:\
then how do i do this.
thanks.

_X_X_X_X_X_X_X_X_X_X_
_X_X_X_X_X_X_X_X_X_X_


Thread:       how to get the current working directory
Message:      00003_0001
From:         dallysome@some.web.address.com
Text:

--- In perl-beginner@yahoogroups.com, "fd97616" <fd97616@y...> wrote:
> hello,
> How do you get the currentl working directory into a variable in perl ?
> and how do you change the directory inside a perl script.
> 
> like say if i am in c:\perl
> and i need to make the current directory as: 
> c:\
> then how do i do this.
> thanks.

Use the 'chdir()' function.

Read about it with:
 (this is for Randall)
  perldoc -f chdir
or
 http://www.perldoc.com/perl5.8.0/pod/func/chdir.html

Even though you are on Windows you can use 
 chdir( '/' );
to get to the root directory. Using forward slashes makes your script
more portable and reg exps and paths easier to read and write.

Use the Cwd module if you need to know your current path.
 perldoc Cwd
or
http://www.perldoc.com/perl5.8.0/lib/Cwd.html

_X_X_X_X_X_X_X_X_X_X_
_X_X_X_X_X_X_X_X_X_X_


